/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import defaultPackage.Vector2;
import jplay.Keyboard;
import jplay.Sprite;

/**
 *
 * @author Marcel
 */
public class Player extends Spaceship {

    private boolean dead;
    private float velocity;

    public Player(String texture, Vector2 position, float velocity) {
        setSprite(texture);
        setPosition(position);
        this.velocity = velocity;
    }
    
    public void shot () {
        
    }

    public void movement(int key) {
        if (key == (Keyboard.LEFT_KEY)) {
            getPosition().setX(getPosition().getX() - velocity);
        }
        if (key == (Keyboard.RIGHT_KEY)) {
            getPosition().setX(getPosition().getX() + velocity);
        }
        if (key == (Keyboard.UP_KEY)) {
            getPosition().setY(getPosition().getY() - velocity);
        }
        if (key == (Keyboard.DOWN_KEY)) {
            getPosition().setY(getPosition().getY() + velocity);
        }
        //System.out.println(getPosition().getX()+" "+ getPosition().getY());
    }

    public boolean isDead() {
        return dead;
    }

    public void setDead(boolean dead) {
        this.dead = dead;
    }
}
